Chapter 4 Calculate Percent Cover of Hydrophytic Species
4.1 Load Data
lpi_CorrectCodes<-read.csv("/Users/elinbinck/Documents/Grad_School/Thesis/R_project/Thesis_Research/data/lpi_tall_CorrectCodes.csv") %>%
select(LineKey,
RecKey,
FormType,
FormDate,
CheckboxLabel,
PrimaryKey,
PointLoc,
PointNbr,
layer,
SpeciesCode,
chckbox,
source,
SpeciesState,
Scientific.Name.with.Author,
CorrectSpeciesCode2)
WetAIMmasterList<- read.csv("/Users/elinbinck/Documents/Grad_School/Thesis/R_project/Thesis_Research/data/WetIndicators/WetlandAIM_MasterSpeciesList.csv") %>%
select(Symbol,
WMVC_WetStatus,
AW_WetStatus,
GP_WetStatus)
Regions<-st_read("/Users/elinbinck/Documents/Grad_School/Thesis/R_project/Thesis_Research/data/coe_regions/USACE_Regions_NAD83.shp")## Reading layer `USACE_Regions_NAD83' from data source
## `/Users/elinbinck/Documents/Grad_School/Thesis/R_project/Thesis_Research/data/coe_regions/USACE_Regions_NAD83.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 11 features and 1 field
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -179.1334 ymin: -14.38165 xmax: 179.7882 ymax: 71.39805
## Geodetic CRS: NAD83
4.2 Remove Soil Surface Codes and non plant codes
Remove all codes that are not vascular plants, so that I can calculate relative % cover
4.3 Calculate the percent relative cover of each species for each transect
After checking for NAs in LineKey, it looks like every entry has a value for that column, so I will go with that.
RelCover<-lpi_CorrectCodesPlants %>%
group_by(PrimaryKey, LineKey) %>%
mutate(NumPlantHits = length(LineKey)) %>%
group_by(PrimaryKey, LineKey,CorrectSpeciesCode) %>%
mutate(NumSpeciesHits = length(CorrectSpeciesCode)) %>%
summarise(RelativeCover = NumSpeciesHits/NumPlantHits) %>%
distinct(.)## `summarise()` has grouped output by 'PrimaryKey', 'LineKey',
## 'CorrectSpeciesCode'. You can override using the `.groups` argument.
4.4 Apply Wetland Indicator Statuses
4.5 Spatially apply the wetland indicator regions
4.5.1 Find the LRRs of every Primary Key
Use the lat long from the header files to match LRRs to each plot
## Coordinate Reference System:
## User input: NAD83
## wkt:
## GEOGCRS["NAD83",
## DATUM["North American Datum 1983",
## ELLIPSOID["GRS 1980",6378137,298.257222101,
## LENGTHUNIT["metre",1]]],
## PRIMEM["Greenwich",0,
## ANGLEUNIT["degree",0.0174532925199433]],
## CS[ellipsoidal,2],
## AXIS["latitude",north,
## ORDER[1],
## ANGLEUNIT["degree",0.0174532925199433]],
## AXIS["longitude",east,
## ORDER[2],
## ANGLEUNIT["degree",0.0174532925199433]],
## ID["EPSG",4269]]